<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue.global.js"></script>
    <style>
        .red{
            color: red;
        }
        .green{
            color: green;
        }
    </style>
</head>
<body>
<div id="app"></div>
<script>
    const app = Vue.createApp({
        data() {
            return {
                classString: 'red',
                classObj: {red:false,green:true},
                classArray: ['green','red',{brown:false}],
                styleString: 'color: yellow',
                styleObj: {
                    color: 'orange'
                }
            }
        },
        methods: {
            pushStyle(){
                this.styleObj['font-size']='50px';
            }
        },
        template: `
          <div :class="classString">Hello World</div>
          <div :class="classObj">YuanPengYue</div>
          <div :class="classArray">YueYue</div>
          <demo class="red"></demo>
          <div :style="styleObj" @click="pushStyle">13245633</div>
          <my-demo class="green"></my-demo>
        `
    });
    app.component('demo',{
        props:['class'],
        template: `
            <div :class=this.$props.class>one</div>
            <div :class=this.$props.class>two</div>
        `
    });
    app.component('my-demo',{
        props:['class'],
        template:`<div :class=this.$props.class>three</div>`
    })
    const vm = app.mount("#app");
</script>
</body>
</html>
